// 这个模块主要用于返回用户所请求的页面
let querystring = require('querystring');
// 前面页面
// 能见得到的页面
exports.getIndexPage = (req, res) => {
    res.render('./index.ejs');
}
exports.getDetailPage = (req, res) => {
    res.render('./detail.ejs')
}
exports.getListPage = (req, res) => {
    res.render('./list.ejs');
}

// 后面管理页面
// 数据会发生变化的

// 注册index
exports.getAdminIndexPage = (req, res) => {
    if (req.session.isLogin && req.session.isLogin == 'true') {
        res.render('admin/index.ejs')
    } else {
        res.writeHead(301, {
            'Location': '/admin/login'
        })
        res.end()
    }
}
exports.getAdminCategoriesPage = (req, res) => {
    res.render('admin/categories.ejs')
}
exports.getAdminLoginPage = (req, res) => {
    res.render('admin/login.ejs')
}
exports.getCommentsPage = (req, res) => {
    res.render('admin/comments.ejs')
}
exports.getNavMenusPage = (req, res) => {
    res.render('admin/nav-menus.ejs')
}
exports.getPasswordResetPage = (req, res) => {
    res.render('admin/password-reset.ejs')
}
exports.getPostAddPage = (req, res) => {
    res.render('admin/post-add.ejs')
}
exports.getPostsPage = (req, res) => {
    res.render('admin/posts.ejs')
}
exports.getProfilePage = (req, res) => {
    res.render('admin/profile.ejs')
}
exports.getSettingsPage = (req, res) => {
    res.render('admin/settings.ejs')
}
exports.getSlidesPage = (req, res) => {
    res.render('admin/slides.ejs')
}
exports.getUsersPage = (req, res) => {
    res.render('admin/users.ejs')
}
